//
//  DYSpaceCell.m
//  DaYing
//
//  Created by DaYing  on 2023.
//  Copyright © 2023年 DaYing . All rights reserved.
//

#import "DYSpaceCell.h"

@implementation DYSpaceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setData:(id)data delegate:(id)delegate {
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        if ([data[@"data"] isKindOfClass:[DYSpaceCellModel class]]) {
            DYSpaceCellModel *model = data[@"data"];
            if (model.bagroundColor) {
                self.contentView.backgroundColor = model.bagroundColor;
            } else {
                self.contentView.backgroundColor = [UIColor clearColor];
            }
        }
    }
}

@end


#pragma mark - Model

@implementation DYSpaceCellModel

+ (DYSpaceCellModel *)ittemModelWithBagroundColor:(UIColor *)bagroundColor {
    DYSpaceCellModel *model = [DYSpaceCellModel new];
    model.bagroundColor = bagroundColor;
    return model;
}

@end
